load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils")

oncall("fbcode_entropy_wardens_folly")

cpp_library(
    name = "mocks",
    headers = ["Mocks.h"],
    exported_deps = [
        "//folly:move_wrapper",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//wangle/channel/broadcast:broadcast_handler",
        "//wangle/channel/broadcast:broadcast_pool",
        "//wangle/channel/broadcast:observing_handler",
        "//wangle/codec:byte_to_message_decoder",
        "//wangle/codec:message_to_byte_encoder",
    ],
)

cpp_unittest(
    name = "broadcast_test",
    srcs = [
        "BroadcastHandlerTest.cpp",
        "BroadcastPoolTest.cpp",
        "ObservingClientPipelineTest.cpp",
        "ObservingHandlerTest.cpp",
    ],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        ":mocks",
        "//folly/portability:gtest",
        "//wangle/bootstrap:client_bootstrap",
        "//wangle/bootstrap:server_bootstrap",
        "//wangle/channel:handler",
        "//wangle/channel/broadcast:broadcast_pool",
        "//wangle/channel/broadcast:observing_handler",
        "//wangle/channel/test:mocks",
        "//wangle/codec:message_to_byte_encoder",
    ],
    external_deps = [
        "glog",
    ],
)
